package com.hairline.hairlinemarket.service.impl;

import com.hairline.hairlinemarket.bean.MarketGoods;
import com.hairline.hairlinemarket.bean.MarketTopic;
import com.hairline.hairlinemarket.bean.MarketTopicExample;
import com.hairline.hairlinemarket.mapper.MarketTopicMapper;
import com.hairline.hairlinemarket.service.TopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import sun.util.resources.cldr.yo.CurrencyNames_yo;

import java.util.ArrayList;
import java.util.List;

/**
 * Author:杨小凯
 * Date:2023-04-20 18:47
 * Description:<描述>
 */
@Service
public class TopicServiceImpl implements TopicService {
    @Autowired
    private MarketTopicMapper marketTopicMapper;
    @Override
    public List queryList(int start, Integer topicLimit) {
        MarketTopicExample marketTopicExample = new MarketTopicExample();
        marketTopicExample.setOrderByClause("add_time");
        List<MarketTopic> marketTopics = marketTopicMapper.selectByExample(marketTopicExample);
        List<MarketTopic> list = new ArrayList<>();
        for (int i = 0; i < topicLimit; i++) {
            list.add(marketTopics.get(i));
        }
        return list;
    }
}
